Skip to content

Fix BZ 70269 - StatementCache regression with drivers that report statements as not poolable - #1083

Merged
markt-asf merged 2 commits into
apache:mainfrom
rvullriede:fix/statementcache-poolable
Oct 16, 2026
Merged

markt-asf merged 2 commits into
apache:mainfrom
rvullriede:fix/statementcache-poolable

Conversation

@rvullriede

Copy link
Copy Markdown
Contributor

https://bz.apache.org/bugzilla/show_bug.cgi?id=70269

bb64a05 made StatementCache cache a statement only when the driver's isPoolable() returns true. H2 and MariaDB Connector/J always return false and ignore setPoolable(), so nothing is cached. The H2-backed TestStatementCache in org.apache.tomcat.jdbc.test has failed since that commit (3 of 8 tests).

Track the application's setPoolable() calls on the cached statement proxy instead. The Statement.setPoolable() Javadoc says prepared and callable statements are poolable when created, so a statement is cached unless the application opted out.

@markt-asf
markt-asf merged commit 87f1a69 into apache:main Oct 16, 2026
markt-asf added a commit that referenced this pull request Oct 16, 2026
markt-asf added a commit that referenced this pull request Oct 16, 2026
markt-asf added a commit that referenced this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants